package com.haogu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.haogu.entity.Announcement;
import com.haogu.entity.Department;
import com.haogu.entity.VAnnouncement;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AnnouncementMapper extends BaseMapper<Announcement> {
    /**
     * 显示所有公告
     * @return
     */
    List<VAnnouncement> selectAnnouncement(@Param("page") Integer page, @Param("rows")Integer rows);

    /**
     * 模糊查询
     * @param page
     * @param rows
     * @param title
     * @param departmentid
     * @return
     */
    List<VAnnouncement> selectLike(@Param("page") Integer page, @Param("rows") Integer rows,
                                   @Param("title") String title,@Param("departmentid") String departmentid);

    /**
     * 查询某条公告
     * @param id
     * @return
     */
    Announcement selectOneAnnous(@Param("id") Integer id);

    /**
     * 部门查询
     * @return
     */
    List<Department> selectDepartment();

    /**
     * 查询公告总数
     * @return
     */
    int selectCounts();
}
